﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class test3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string s = TextBox1.Text.ToString();
        string s1 = TextBox2.Text.ToString();
        int a = MyClass.MinMultiple(int.Parse(s), int.Parse(s1));
        Label3.Text=s + "和" + s1 + "的最小公倍数为：" + a;
    }
}
public class MyClass
{
    public static int MinMultiple(int a,int b)
    {
        int minMultiple = (a > b) ? a : b;
        while (true)
        {
            if (minMultiple % a == 0 && minMultiple % b == 0)
            {
                break;
            }
            minMultiple++;
        }
        return minMultiple;
    }

}